macro(import_lib IMPORTED_LIBS)
    if (MSVC)
        set(lib_ext ".lib")
    else ()
        set(lib_ext ".a")
    endif ()

    foreach (arg IN ITEMS ${ARGN})
        set(lib_fullpath "")
        unset(lib_available_names)

        message(STATUS "Import lib, name=" ${arg})
        if (${BUILD_DEBUG})
            list(APPEND lib_available_names ${arg}d)
            list(APPEND lib_available_names ${arg}_d)
            list(APPEND lib_available_names ${arg}_debug)
            list(APPEND lib_available_names lib${arg}d)
            list(APPEND lib_available_names lib${arg}_d)
            list(APPEND lib_available_names lib${arg}_debug)
        endif ()
        list(APPEND lib_available_names ${arg})
        list(APPEND lib_available_names lib${arg})

        foreach (f IN ITEMS ${lib_available_names})
            set(lib_temp ${DEPENDS_DIR}/lib/${f}${lib_ext})
            if (EXISTS ${lib_temp})
                set(lib_fullpath ${lib_temp})
                break()
            endif ()
        endforeach ()

        if (lib_fullpath STREQUAL "")
            message(FATAL_ERROR "Import lib failed, name=" ${arg})
            continue()
        endif ()

        message(STATUS "Import lib ok, name=" ${arg} " path=" ${lib_fullpath})
        list(APPEND ret ${lib_fullpath})

    endforeach ()

    set(IMPORTED_LIBS ${ret})
endmacro()